#ifndef PHYCOLLISIONOBJECTS_H
#define PHYCOLLISIONOBJECTS_H

#include <osg/PositionAttitudeTransform>
#include <osg/Geode>
#include "PHYUtils.h"
#include <list>
using namespace std;

/**
Basic class that implements a collision object.
/**/
class PHYCollisionObj //: public osg::Referenced
{
public:
	void setLocation(PHYVector &iLoc);
	PHYVector getLocation() const;
	PHY_Shapes getShape() const;
	int getIndex();
	osg::PositionAttitudeTransform* getTransform();
	PHYCollisionObj& operator=(const PHYCollisionObj &rhs);
	int operator==(const PHYCollisionObj &rhs) const;
	int operator<(const PHYCollisionObj &rhs) const;
	//PHYCollisionObj* operator->();
protected:
	//PHYCollisionObj();
	PHYCollisionObj(PHY_Shapes iShape, osg::Geode *iGeode, PHYVector &iLocation);
	PHYCollisionObj(PHY_Shapes iShape, osg::Node *ipNode, PHYVector &iLocation);
	osg::PositionAttitudeTransform*			_Object;
private:
	PHY_Shapes													_Shape;
	PHYVector														_Location;
	static int													_index;
	int																	_thisIndex;
};

/**
Class to implement a sphere shape
/**/
class PHYSphere : public PHYCollisionObj
{
public:
	PHYSphere(osg::Geode *iGeode, double iRadius, PHYVector &iOrigin);
	//osg::PositionAttitudeTransform* getTransform();
	void setRadius(double);
	double getRadius();
private:
	double _Radius;
};

/**
Class to implement a box shape
/**/
class PHYBox : public PHYCollisionObj
{
public:
	PHYBox(osg::Geode *iGeode, double iX, double iY, double iZ, PHYVector &iOrigin);
	double getX(){return _X;};
	double getY(){return _Y;};
	double getZ(){return _Z;};
	//osg::PositionAttitudeTransform* getTransform();
private:
	double _X, _Y, _Z;
};

class PHYConvex : public PHYCollisionObj
{
public:
	PHYConvex(osg::Node *ipNode, char* iFName, PHYVector &iOrigin);
	char *GetFileName();
private:
	char*			_filename;
};
#endif
